<template>
	<div class="search-container">
		<div>
			<el-input v-model="input" placeholder="请输入内容" class="search-input"></el-input>
			<el-button type="primary" @click="search">筛选</el-button>
		</div>
		<div>
			<el-button type="primary" @click="deleteBatchData">批量删除</el-button>
			<el-button type="primary" @click="openDialog">添加</el-button>
		</div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			input: "",
		};
	},
	methods: {
		deleteBatchData() {
			this.$bus.$emit("deletebatchData", this.input);
		},
		search() {
			this.$bus.$emit("search", this.input);
		},
		openDialog() {
			let dialog = this.$parent.$refs.dialog;
			dialog.btnType = 0;
			dialog.form = {};
			console.log(dialog.form);
			dialog.dialogVisible = true;
		},
	},
};
</script>

<style lang="less" scoped>
.search-container {
	flex-basis: 62px;
	box-sizing: border-box;
	display: flex;
	justify-content: space-between;
	background-color: #fff;
	padding: 15px;
	.search-input {
		width: 160px;
		margin-right: 20px;
	}
}
</style>
